<meta charset="UTF-8">
<div id="oil-leakage-report">
    <div class="demo-spin-container" v-if="isSpin">
        <Spin size="large" fix></Spin>
    </div>
    <Modal v-model="markerModal" width="500">
        <p slot="header" style="color:#f60;text-align:center">
            <Icon type="ios-create-outline"></Icon>
            <span>{{$t('reportForm.editMarker')}}</span>
        </p>
        <Row style="margin:10px 0;">
            <i-col span="5" style="line-height: 32px;text-align: right;">
                {{$t('monitor.remarks')}}:
            </i-col>
            <i-col span="14" offset="1">
                <i-input v-model.trim="marker"></i-input>
            </i-col>
        </Row>
        <div slot="footer" style="text-align:center;">
            <i-button type="primary" style="width: 240px" @click="editOilRecord">{{$t('header.submit')}}</i-button>
        </div>
    </Modal>
    <div class="report-item-header">
        <Row style="margin:10px;height: 35px;">
            <div class="fl">
                <div>{{$t("reportForm.selectDev")}}:&nbsp;</div>
            </div>
            <div style="position: relative;width: 240px;" class="fl">
                <div class="search-wrapper" v-click-outside.capture="onClickOutside">
                    <i-input v-model.trim="sosoValue" icon="ios-close-circle-outline" @on-change="sosoValueChange" @on-focus="focus" :placeholder="placeholder" @on-click="onClickIcon"></i-input>
                    <transition name="fade">
                        <div class="search-item-wrapper" v-show="isShowMatchDev">
                            <ul id="ztree" class="ztree"></ul>
                        </div>
                    </transition>
                </div>
            </div>
            <div style="margin-left:10px;" class="fl">
                {{$t("reportForm.selected")}}: <span v-text="selectedCount"></span>
            </div>
            <div style="margin-left:10px;width: 80px;position: relative;" class="fl">
                <i-select v-model="tank">
                    <i-option v-for="(item,index) in oilIndexLabel" :value="item.value" :key="index">{{item.label}}</i-option>
                </i-select>
            </div>
            <div style="padding-left: 10px;" class="fl">
                <span>{{$t("reportForm.selectTime")}}:</span>
                <date-picker type="daterange" :value="dateVal" :editable="false" :clearable="false" @on-change="onChange" show-week-numbers style="width:180px" placement="bottom-start"></date-picker>
            </div>
            <div style="margin-left: 20px;" class="spans-wrap fl">
                <span class="cursor-pointer" @click="handleSelectdDate(0)" :style="{color: dayNumberType == 0 ? '#2D8CF0' : '#515A6E'}">{{$t("reportForm.toDay")}}</span> <b>｜</b>
                <span class="cursor-pointer" @click="handleSelectdDate(1)" :style="{color: dayNumberType == 1 ? '#2D8CF0' : '#515A6E'}">{{$t("reportForm.yesterDay")}}</span> <b>｜</b>
                <span class="cursor-pointer" @click="handleSelectdDate(3)" :style="{color: dayNumberType == 3 ? '#2D8CF0' : '#515A6E'}">{{$t("reportForm.threeDays")}}</span>
            </div>
            <div style="margin-left:10px;" class="fl">
                <i-button @click="onClickQuery">{{$t("reportForm.query")}}</i-button>
            </div>
        </Row>
        <div style="width:100%;height: 225px;position: relative;">
            <div id="charts" style="height: 225px;width: 100%;"></div>
        </div>
        <div style="margin:10px;">
            <Tabs :value="activeTab" @on-click="onClickTab">
                <Tab-pane :label="$t('reportForm.oilLeakageStatistics')" name="tabTotal">
                    <i-table ref="totalTable" size="small" :columns="allColumns" :data="allTableData" :height="lastTableHeight" :loading="loading"></i-table>
                </Tab-pane>
                <Tab-pane :label="$t('reportForm.oilLeakageDetailed')" name="tabDetail">
                    <i-table ref="detailTable" size="small" :columns="columns" :height="lastTableHeight" :row-class-name="rowClassName" :data="tableData" :loading="loading" @on-sort-change="onSortChange"></i-table>
                </Tab-pane>
                <i-button type="primary" size="small" slot="extra" style="margin:7px 5px 0 0;" @click="exportData">{{$t("reportForm.exportData")}}</i-button>
            </Tabs>
        </div>
    </div>
    <transition name="fade">
        <div v-show="trackDetailModal" class="posi-map-wraper">
            <div class="map-modal" @click="trackDetailModal=false"></div>
            <div class="work-inner-map-wraper">
                <div class="posi-map-title">
                    {{$t("monitor.track")}}
                    <div class="map-close"></div>
                </div>
                <div id="oil-leakage-details-map" class="work-details-map"></div>
            </div>
        </div>
    </transition>
</div>